Socket
Socket
Sign inDemoInstall

@stdlib/assert-is-number

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-is-number

Test if a value is a number.


Version published
Weekly downloads
378K
decreased by-17.51%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-is-number?

@stdlib/assert-is-number is a utility package that provides functions to check if a value is a number. It includes checks for different types of numbers such as finite numbers, integers, and NaN values.

What are @stdlib/assert-is-number's main functionalities?

isNumber

The `isNumber` function checks if a value is a number. It returns `true` if the value is a number and `false` otherwise.

const isNumber = require('@stdlib/assert-is-number');
console.log(isNumber(5)); // true
console.log(isNumber('5')); // false

isFinite

The `isFinite` function checks if a value is a finite number. It returns `true` if the value is finite and `false` otherwise.

const isFinite = require('@stdlib/assert-is-number').isFinite;
console.log(isFinite(5)); // true
console.log(isFinite(Infinity)); // false

isInteger

The `isInteger` function checks if a value is an integer. It returns `true` if the value is an integer and `false` otherwise.

const isInteger = require('@stdlib/assert-is-number').isInteger;
console.log(isInteger(5)); // true
console.log(isInteger(5.5)); // false

isNaN

The `isNaN` function checks if a value is NaN (Not-a-Number). It returns `true` if the value is NaN and `false` otherwise.

const isNaN = require('@stdlib/assert-is-number').isNaN;
console.log(isNaN(NaN)); // true
console.log(isNaN(5)); // false

Other packages similar to @stdlib/assert-is-number

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc